var CronJob = require('cron').CronJob;
var superagent = require('superagent');
new CronJob('0 20 * * * *', function() {
  console.log('You will see this message every second');
  superagent.post("http://localhost:6208/spider/writechapter").send()
  superagent
  .post('http://localhost:6208/spider/writechapter')
  .send() // sends a JSON post body  
  .end((err, res) => {
      console.log("err:"+err)
      console.log("res:"+res)
    // Calling the end function will send the request
  });
}, null, true, 'America/Los_Angeles');
